﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<DVSProject.Models.MachineModels>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	List Machine
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>List Machine</h2>
     <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>
    <div class="CSSTableGenerator">
    <table>
        <tr>
            <th></th>
            <th>
                Serial No
            </th>
            <%--<th>
                ModelId
            </th>--%>
            <th>
                Model
            </th>
            <th>
                Brand
            </th>
            <th>
                Name Th
            </th>
            <th>
                Name Eng
            </th>
             <th>
                Max Meter no
            </th>
            <th>
                Start Meter no
            </th>
            <th>
                Last meter no
            </th>
          <%--  <th>
                Status
            </th>
            <th>
                Create By
            </th>
            <th>
                Create On
            </th>
            <th>
                Update By
            </th>
            <th>
                Update On
            </th>--%>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new {id= item .SerialNo  /* id=item.PrimaryKey */ }) %> |
                <%= Html.ActionLink("Details", "Details", new { id = item.SerialNo /* id=item.PrimaryKey */ })%> |
                <%= Html.ActionLink("Delete", "Delete", new { id = item.SerialNo/* id=item.PrimaryKey */ })%>
            </td>
            <td>
                <%= Html.Encode(item.SerialNo) %>
            </td>
           <%-- <td>
                   <%= Html.Encode(item.ModelId) %>
            </td>--%>
            <td>
                   <%= Html.Encode(item.Model_NameTh) %>
            </td>
            <td>
                <%= Html.Encode(item.Brand) %>
            </td>
            <td>
                <%= Html.Encode(item.NameTh) %>
            </td>
            <td>
                <%= Html.Encode(item.NameEng) %>
            </td>
             <td>
                <%= Html.Encode(String.Format("{0:0.##}", item.max_meter_no))%>
            </td>
              <td>
                <%= Html.Encode(String.Format("{0:0.##}", item.start_meter_no))%>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:0.##}", item.last_meter_no))%>
            </td>
            <%--<td>
                <%= Html.Encode(item.Status) %>
            </td>
            <td>
                <%= Html.Encode(item.CreateBy) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.CreateOn)) %>
            </td>
            <td>
                <%= Html.Encode(item.UpdateBy) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.UpdateOn)) %>
            </td>--%>
        </tr>
    
    <% } %>

    </table></div>

   

</asp:Content>

